using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Threading;
using IGlobalist.Cms.Common;
using IGlobalist.Chat.Engine;
using log4net;

namespace IGlobalist.Cms
{
    public class Global : System.Web.HttpApplication
    {
        public static readonly ILog log = LogManager.GetLogger("com.paypal.sdk.samples");
        protected void Application_Start(object sender, EventArgs e)
        {
            log4net.Config.XmlConfigurator.Configure();
            System.Threading.Timer ChatRoomsCleanerTimer = new System.Threading.Timer(new TimerCallback(ChatEngine.CleanChatRooms), null, 1200000, 1200000);
        }

        protected void Application_End(object sender, EventArgs e)
        {

            SiteConfig.SaveConfig(); 
          
            
        }

        protected void Session_Start(object sender, EventArgs e)
        {
            SiteConfig.SiteAccessNumber += 1;
            Session[SessionVariable.Common.SiteAccessNumber] = SiteConfig.SiteAccessNumber;
            
            

        }
    }
}